[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
RANDOM(IEXP) (INTEGER)
Function
Return a random number between 0 and a specified limit.
Syntax
RANDOM(limit)
limit = An integer expression with the maximum random value desired.
Return Type & Value
INTEGER
Returns the random number in the range 0 to limit.
Remarks
Random numbers have many applications from statistics to video games.
This function allows you to generate pseudo-random numbers in the range
0 to limit inclusive.
Examples
INTEGER x,y
WHILE (KINKEY() <> " ") DO
CLS
LET x = 1+RANDOM(50)
LET y = 1+RANDOM(22)
COLOR 1+RANDOM(14)
ANSIPOS x,y
PRINT "Hit the SPACE BAR to continue"
DELAY 18
ANSIPOS x,y
CLREOL
ENDWHILE
See Also:
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson